<?php

function get_quote_message(){
	$xml = simplexml_load_file("lib/messages.xml");
	$messages = $xml->xpath('message');
	
	return $messages[rand(0, count($messages)-1)];
}

function load_page($page="index"){	
	$path = "pages/{$page}.php";
	if(!file_exists($path)){
		$path = "pages/index.php";
	}
	
	ob_start();
	include $path;
	$content = ob_get_contents();
	ob_clean();
	
	return $content;
}

?>